package com.mlc.mlcitems;

import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.*;
import org.jetbrains.annotations.NotNull;

public class clearall implements CommandExecutor {
    @Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String @NotNull [] strings) {
        Player player = (Player) commandSender;
        Location loc = player.getLocation();
        int radius = 100;
        for (Entity entity : player.getWorld().getNearbyEntities(loc, radius, radius, radius)) {
            if (entity instanceof TextDisplay) {
                entity.remove();
            }
            if (entity instanceof ItemDisplay) {
                entity.remove();
            }
        }
        return false;
    }
}
